// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_f;

import android.text.TextUtils;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
import org.xml.sax.Attributes;

// Referenced classes of package com.nnee.f:
//            f, g

public class cls_b extends cls_f
    implements Cloneable
{

    public cls_b(cls_b b1)
    {
        super(b1.z(), b1.A());
        e = 1;
        f = 2;
        i = f;
        a(b1);
    }

    public cls_b(String s)
    {
        this(s, null);
    }

    public cls_b(String s, String s1)
    {
        super(s, s1);
        e = 1;
        f = 2;
        i = f;
        if(TextUtils.isEmpty(s))
            i = e;
        else
            i = f;
    }

    public static boolean a(cls_b b1, cls_b b2)
    {
        boolean flag;
        if(b1 == null)
        {
            if(b2 == null)
                flag = true;
            else
                flag = false;
        } else
        {
            flag = b1.c(b2);
        }
        return flag;
    }

    private void c(OutputStream outputstream)
    {
        if(o())
            return;
        com.nnee.p_f.cls_g.a(outputstream, "<");
        try {
			outputstream.write(ad.getBytes());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        if(g == null) {
        	 com.nnee.p_f.cls_g.a(outputstream, ">");
             if(!TextUtils.isEmpty(ae))
				try {
					outputstream.write(m(ae).getBytes());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
             if(h == null) {} else{
            	 List list = h;
                 
                 cls_b b1;
                 for(Iterator iterator = h.iterator(); iterator.hasNext(); b1.d(outputstream))
                 {
                     b1 = (cls_b)iterator.next();
                     b1.c(outputstream);
                 }

                 
             }
        }else {
        	List list1 = g;
            
            for(Iterator iterator1 = g.iterator(); iterator1.hasNext(); ((cls_f)iterator1.next()).b(outputstream));
            
        }
 
    }

    private void d(OutputStream outputstream)
    {
        if(!o())
        {
            com.nnee.p_f.cls_g.a(outputstream, "</");
            try {
				outputstream.write(ad.getBytes());
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            com.nnee.p_f.cls_g.a(outputstream, ">");
        }
    }

    public double a(String s, double d1)
    {
        cls_f f1;
        if(g == null || s == null)
            return 0;
        f1 = b(s);
        if(f1 == null)
        	return 0;
        double d2 = Double.parseDouble(f1.A());
        d1 = d2;
 
        return d1;
        
    }

    public float a(String s, float f1)
    {
        cls_f f2;
        if(g == null || s == null)
           return 0;
        f2 = b(s);
        if(f2 == null)
        	return 0;
        float f3 = Float.parseFloat(f2.A());
        f1 = f3;
 
        return f1;
        
    }

    public int a(String s, int i1)
    {
        cls_f f1;
        if(g == null || s == null)
        	return 0;
        f1 = b(s);
        if(f1 == null)
        	return 0;
        int j1 = Integer.parseInt(f1.A());
        i1 = j1;

        return i1;

    }

    public long a(String s, long l1)
    {
        cls_f f1;
        if(g == null || s == null)
        	return 0;
        f1 = b(s);
        if(f1 == null)
        	return 0;
        long l2 = Long.parseLong(f1.A());
        l1 = l2;

        return l1;

    }

    public cls_b a(String s, String s1)
    {
        return d(new cls_b(s, s1));
    }

    public String a(String s)
    {
        return d(s, null);
    }

    public void a(cls_b b1)
    {
        if(b1 != null && this != b1) {
        	g(b1.A());
            if(b1.g == null) {
            	 g = null;
            	 if(b1.h == null)
                     return;
                 if(h == null)
                     h = new LinkedList();
                 List list = h;
                 
                 h.clear();
                 Iterator iterator = b1.h.iterator();
                 do
                 {
                     if(!iterator.hasNext())
                         break;
                     cls_b b2 = (cls_b)iterator.next();
                     cls_b b3 = a(b2.z(), b2.A());
                     if(b3 != null)
                         b3.a(b2);
                 } while(true);
                 
            } else {
            	if(g == null)
                    g = new LinkedList();
                List list1 = g;
                
                g.clear();
                cls_f f1;
                for(Iterator iterator1 = b1.g.iterator(); iterator1.hasNext(); b(f1.z(), f1.A()))
                    f1 = (cls_f)iterator1.next();

                
            }
        }
 
    }

    public void a(cls_f f1)
    {
        if(g == null)
            g = new LinkedList();
        List list = g;
         
        g.add(f1);
        return;
    }

    public void a(Attributes attributes, Map map)
    {
        int i1 = 0;
        if(attributes != null)
            if(map != null && map.size() > 0)
            {
                int j1 = i1;
                while(j1 < attributes.getLength()) 
                {
                    String s = attributes.getURI(j1);
                    String s1 = null;
                    if(s != null && s.length() > 0)
                        s1 = (String)map.get(s);
                    String s2 = attributes.getLocalName(j1);
                    String s3;
                    if(s1 != null)
                        s3 = (new StringBuilder()).append(s1).append(':').append(s2).toString();
                    else
                        s3 = s2;
                    b(s3, attributes.getValue(j1));
                    j1++;
                }
            } else
            {
                for(; i1 < attributes.getLength(); i1++)
                    b(attributes.getLocalName(i1), attributes.getValue(i1));

            }
    }

    public boolean a(OutputStream outputstream)
    {
        boolean flag = false;
        c(outputstream);
        d(outputstream);
        flag = true;
 
        return flag;
        
    }

    public cls_f b(String s)
    {
    	 cls_f f1 = null;
        if(g == null || s == null){
        	f1 = null;
        } else {
        	 List list = g;
    
             Iterator iterator = g.iterator();
             while(true)
             {
             if(!iterator.hasNext()) {
            	 f1 = null;
            	 return f1;
             } else {
            	 f1 = (cls_f)iterator.next();
                 if(!f1.z().equals(s)) {continue;} else {return f1;}
             }
             }
        }
        
        return f1;
 
    }

    public void b(cls_b b1)
    {
        if(h == null || b1 == null)
            return;
        List list = h;
      
        h.remove(b1);
    }

    public void b(String s, String s1)
    {
        a(new cls_f(s, s1));
    }

    public cls_b c(String s)
    {
    	cls_b b1 = null;
        if(h == null || s == null) {
        	b1 = null;
        } else 
        {
        	 List list = h;
              
             Iterator iterator = h.iterator();
             while(true){
             if(!iterator.hasNext()) {
            	 b1 = null;
            	 return b1;
             } else {
            	 b1 = (cls_b)iterator.next();
                 if(!s.equals(b1.z())) {continue;} else {
                	 return b1;
                	 
                 }
             }
             }
        }
        return b1;
 
    }

    public void c(String s, String s1)
    {
        cls_f f1 = b(s);
        if(f1 != null)
            f1.g(s1);
        else
            b(s, s1);
    }

    protected boolean c(cls_b b1)
    {
        boolean flag = false;
        if(b1 != null) {
        	 if(ae != null)
                 flag = ae.equals(b1.ae);
             else
             if(b1.ae == null)
                 flag = true;
        }
 
        return flag;

    }

    public   Object clone()
    {
        return l();
    }

    public cls_b d(cls_b b1)
    {
        if(b1 != null) {
        	if(h == null)
                h = new LinkedList();
            List list = h;
            
            h.add(b1);
            
        }
 
        return b1;
 
    }

    public String d(String s, String s1)
    {
        if(g != null && s != null)
        {
            cls_f f1 = b(s);
            if(f1 != null)
                s1 = f1.A();
        }
        return s1;
    }

    public List d(String s)
    {
    	LinkedList linkedlist1 =null;
        if(h == null) {}else {
        	 LinkedList linkedlist = new LinkedList();
             List list = h;
            
             if(s == null)
             {
                 Iterator iterator1 = h.iterator();
                 do
                 {
                     if(!iterator1.hasNext())
                         break;
                     cls_b b2 = (cls_b)iterator1.next();
                     if(b2.z() == null || b2.z().length() == 0)
                         linkedlist.add(b2);
                 } while(true);
                 
             }
             else
             {
             Iterator iterator = h.iterator();
             do
             {
                 if(!iterator.hasNext())
                     break;
                 cls_b b1 = (cls_b)iterator.next();
                 if(s.equals(b1.z()))
                     linkedlist.add(b1);
             } while(true);
             
             if(linkedlist.size() <= 0) {
            	 linkedlist1 = null;
            	 return linkedlist1;
             } else {
            	 linkedlist1 = linkedlist;
             }
             }
              linkedlist1 = linkedlist;
     
             return linkedlist1;
        }
        
        return linkedlist1;
 
    }

    public void e(String s)
    {
        if(!TextUtils.isEmpty(s))
            d(a(((String) (null)), s));
    }

    public cls_b f(String s)
    {
        return a(s, ((String) (null)));
    }

    public void i()
    {
        g(null);
        if(g != null)
        {
            g.clear();
            g = null;
        }
        if(h != null)
        {
            h.clear();
            h = null;
        }
    }

    public void j()
    {
        if(h != null)
        {
            synchronized(h)
            {
                h.clear();
            }
            h = null;
        }
        return;
        
    }

    public void k()
    {
        if(g != null)
        {
            g.clear();
            g = null;
        }
    }

    public cls_b l()
    {
        cls_b b1 = new cls_b(z(), A());
        if(h != null)
        {
            for(Iterator iterator1 = h.iterator(); iterator1.hasNext(); b1.d(((cls_b)iterator1.next()).l()));
        }
        if(g != null)
        {
            cls_f f1;
            for(Iterator iterator = g.iterator(); iterator.hasNext(); b1.b(f1.z(), f1.A()))
                f1 = (cls_f)iterator.next();

        }
        return b1;
    }

    public boolean m()
    {
        boolean flag;
        if(h != null && h.size() > 0 && i == f)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public boolean n()
    {
        boolean flag;
        if(g == null || g.size() <= 0)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public boolean o()
    {
        boolean flag;
        if(i == e)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public List p()
    {
        return g;
    }

    public List q()
    {
        return h;
    }

    public void r()
    {
    }

    public String toString()
    {
        StringBuilder stringbuilder = new StringBuilder();
        if(o()) {
        	 if(!TextUtils.isEmpty(ae))
                 stringbuilder.append(m(ae));
        	 if(!o())
             {
                 stringbuilder.append("</");
                 stringbuilder.append(ad);
                 stringbuilder.append(">");
             }
             return stringbuilder.toString();
        } else {
        	stringbuilder.append("<");
            stringbuilder.append(ad);
            if(g == null) {
            	stringbuilder.append(">");
                if(!TextUtils.isEmpty(ae))
                    stringbuilder.append(m(ae));
                if(h == null) {} else {
                	List list = h;
                    
                    for(Iterator iterator = h.iterator(); iterator.hasNext(); stringbuilder.append(((cls_b)iterator.next()).toString()));
                    
                }
            } else {
            	 List list1 = g;
                 
                 for(Iterator iterator1 = g.iterator(); iterator1.hasNext(); stringbuilder.append(((cls_f)iterator1.next()).toString()));
                 
            }
        }
        return stringbuilder.toString();    }

    int e;
    int f;
    List g;
    List h;
    int i;
}
